<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <h:head>
        <title>#{pageTitle}</title>
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />

        <style type="text/css">
            .ui-layout-north, .ui-layout-south {
                border: none;
            }

            .ui-button-text {
                padding: 10px ;
            }

            .ui-layout-center {
                padding: 10px;
            }

            .ui-layout-north {
                overflow:visible !important;
            }
        </style>


    </h:head>
    <h:body>
        <f:view locale="#{locale.locale}" id="mainf">
            <p:layout fullPage="true" collapseTitle="#{trans.b_collapse}" widgetVar="layoutWdgt" expandTitle="#{trans.b_expand}" >
                <p:layoutUnit id="top" position="north" size="47">
                    <ui:insert name="top" >

                        <ul class="menubar">
                            <li style="float: left; padding-top: 2px;"> <h2>#{trans.system_name}</h2></li>

                            <li style="padding-left: 10px;" ><p:commandButton action="#{login.logoutUser()}" title="#{trans.b_logout}" icon="ui-icon-closethick" style="width: 27px; height: 25px; margin-top: 7px; margin-right: 10px; "/></li>

                            <li><p:commandButton onclick="dlg2.show();" title="#{trans.b_help}" icon="ui-icon-help" style="width: 27px; height: 25px; margin-top: 7px; margin-right: 0px; "/></li>

                            <li >
                                <h:form> 
                                    <p:themeSwitcher style="width:155px; margin-top: 5px;" value="#{theme.theme}" effect="fade" >  
                                        <f:selectItem itemLabel="#{trans.b_skin}"  itemValue="" />
                                        <f:selectItems value="#{theme.themes}" />
                                        <p:ajax listener="#{theme.saveTheme}" />
                                    </p:themeSwitcher>
                                </h:form>

                            </li>

                            <li >

                                <h:form id="lang2" style="padding-top: 9px;">
                                    <h:commandLink action="#{locale.changeLanguage('cs')}" value="Čeština" immediate="true" />
                                    <h:outputLabel value=" | " />
                                    <h:commandLink action="#{locale.changeLanguage('en')}" value="English" immediate="true" />

                                </h:form>
                            </li>

                        </ul>
                    </ui:insert>
                </p:layoutUnit>


                <p:layoutUnit position="west" size="250" resizable="false" closable="false" collapsible="true">

                    <p:commandButton title="#{trans.b_collapse}" onclick="layoutWdgt.toggle('west')" style="position: absolute; top: 0px; right: 0px; width: 16px; height: 16px;" icon="ui-icon-triangle-1-w"/>

                    <div id="welcome">
                        #{trans.welcome} <span>#{login.loginName}</span><br/>
                        <div style="font-size: 70%; margin-top: 5px;">#{trans.lastLogin}: 20.10.2012</div>

                    </div>


                    <h:form rendered="#{user.student}"> 
                        <ui:include src="/WEB-INF/includes/menu.xhtml"/>
                    </h:form>
                    
                    <h:form rendered="#{!user.student}"> 
                        <ui:include src="/WEB-INF/includes/menuTeacher.xhtml" />
                    </h:form>
                    
                    

                    <p:fieldset legend="#{trans.overview}" toggleable="true" toggleSpeed="500" collapsed="true" >  

                        <ui:include src="/WEB-INF/includes/overview.xhtml"/>


                    </p:fieldset>  


                </p:layoutUnit>

                <p:layoutUnit position="center">
                    <ui:insert name="content">hlavni obsah</ui:insert>
                </p:layoutUnit>

                <p:layoutUnit position="south" size="30"  resizable="false" closable="false" collapsible="false">
                    <ui:include src="/WEB-INF/includes/footer.xhtml"/>
                </p:layoutUnit>

            </p:layout>

            <p:dialog id="modalDialog" header="#{trans.b_help}" widgetVar="dlg2" modal="true" height="300" width="400" showEffect="fade" hideEffect="clip">  
                <ui:include src="/WEB-INF/includes/help.xhtml"/> 
            </p:dialog> 

            <p:growl id="messages" life="2000" />

        </f:view>


    </h:body>
</html>